import re
headers_str = """
Host:op.yundasys.com
Connection:keep-alive
User-Agent:Mozilla/5.0 (Linux; Android 7.1.2; TAS-AN00 Build/TAS-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3770.143 Mobile Safari/537.36 MMWEBID/3766 MicroMessenger/8.0.3.1880(0x28000334) Process/appbrand0 WeChat/arm32 Weixin NetType/WIFI Language/zh_CN ABI/arm32 MiniProgramEnv/android
charset:utf-8
Accept-Encoding:gzip,compress,br,deflate
content-type:application/json
Referer:https://ser
"""

for line in headers_str.splitlines():
	# \1和\2用来匹配分组的内容
    print(re.sub('^(.*?):(.*)$',r"'\1': '\2',",line))

